package semantica;

import java.util.ArrayList;

public class PatternListAttributeType extends TypeAttribute {

	private String pattern;
	private ArrayList<String> list;

	public PatternListAttributeType(String pattern, ArrayList<String> list) {
		this.pattern = pattern;
		this.list = list;
	}

	@Override
	public boolean validate(String val) {
		if (new PatternAttributeType(pattern).validate(val))
			return true;

		if (new ListAttributeType(list).validate(val))
			return true;

		return false;
	}

}
